home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / AppleScript.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  6.1 KB  |  215 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        AppleScript.a
  3. ;
  4. ;    Contains:    AppleScript Specific Interfaces.
  5. ;
  6. ;    Version:    Technology:    AppleScript 1.1
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__APPLESCRIPT__') = 'UNDEFINED' THEN
  21. __APPLESCRIPT__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__ERRORS__') = 'UNDEFINED' THEN
  25.     include 'Errors.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__APPLEEVENTS__') = 'UNDEFINED' THEN
  30.     include 'AppleEvents.a'
  31.     ENDIF
  32. ;        include 'Types.a'                                            ;
  33. ;        include 'Memory.a'                                            ;
  34. ;            include 'MixedMode.a'                                    ;
  35. ;        include 'OSUtils.a'                                        ;
  36. ;        include 'Events.a'                                            ;
  37. ;            include 'Quickdraw.a'                                    ;
  38. ;                include 'QuickdrawText.a'                            ;
  39. ;        include 'EPPC.a'                                            ;
  40. ;            include 'AppleTalk.a'                                    ;
  41. ;            include 'Files.a'                                        ;
  42. ;                include 'Finder.a'                                    ;
  43. ;            include 'PPCToolbox.a'                                    ;
  44. ;            include 'Processes.a'                                    ;
  45. ;        include 'Notification.a'                                    ;
  46.  
  47.     IF &TYPE('__OSA__') = 'UNDEFINED' THEN
  48.     include 'OSA.a'
  49.     ENDIF
  50. ;        include 'AEObjects.a'                                        ;
  51. ;        include 'Components.a'                                        ;
  52.  
  53.     IF &TYPE('__TEXTEDIT__') = 'UNDEFINED' THEN
  54.     include 'TextEdit.a'
  55.     ENDIF
  56.  
  57. typeAppleScript                    EQU        'ascr'
  58. kAppleScriptSubtype                EQU        typeAppleScript
  59. typeASStorage                    EQU        typeAppleScript
  60.  
  61. ;*************************************************************************
  62. ;    Component Selectors
  63. ;*************************************************************************
  64. kASSelectInit                    EQU        $1001
  65. kASSelectSetSourceStyles        EQU        $1002
  66. kASSelectGetSourceStyles        EQU        $1003
  67. kASSelectGetSourceStyleNames    EQU        $1004
  68.  
  69. ;*************************************************************************
  70. ;    OSAGetScriptInfo Selectors
  71. ;*************************************************************************
  72. kASHasOpenHandler                EQU        'hsod'
  73.  
  74. ;
  75. ;        This selector is used to query a context as to whether it contains
  76. ;        a handler for the kAEOpenDocuments event. This allows "applets" to be 
  77. ;        distinguished from "droplets."  OSAGetScriptInfo returns false if
  78. ;        there is no kAEOpenDocuments handler, and returns the error value 
  79. ;        errOSAInvalidAccess if the input is not a context.
  80. ;    
  81. ;*************************************************************************
  82. ;    Initialization
  83. ;*************************************************************************
  84. ;
  85. ; pascal OSAError ASInit(ComponentInstance scriptingComponent, long modeFlags, long minStackSize, long preferredStackSize, long maxStackSize, long minHeapSize, long preferredHeapSize, long maxHeapSize)
  86. ;
  87.     IF ¬ GENERATINGCFM THEN
  88.         Macro
  89.         _ASInit
  90.             dc.w     $2F3C
  91.             dc.w     $001C
  92.             dc.w     $1001
  93.             moveq    #0,d0
  94.             dc.w     $A82A
  95.         EndM
  96.     ELSE
  97.         IMPORT_CFM_FUNCTION    ASInit
  98.     ENDIF
  99.  
  100. ;
  101. ;        ComponentCallNow(kASSelectInit, 28);
  102. ;        This call can be used to explicitly initialize AppleScript.  If it is
  103. ;        not called, the a scripting size resource is looked for and used. If
  104. ;        there is no scripting size resource, then the constants listed below
  105. ;        are used.  If at any stage (the init call, the size resource, the 
  106. ;        defaults) any of these parameters are zero, then parameters from the
  107. ;        next stage are used.  ModeFlags are not currently used.
  108. ;        Errors:
  109. ;        errOSASystemError        initialization failed
  110. ;    
  111. ;
  112. ;    These values will be used if ASInit is not called explicitly, or if any
  113. ;    of ASInit's parameters are zero:
  114. ;
  115. kASDefaultMinStackSize            EQU        4 * 1024
  116. kASDefaultPreferredStackSize    EQU        16 * 1024
  117. kASDefaultMaxStackSize            EQU        16 * 1024
  118. kASDefaultMinHeapSize            EQU        4 * 1024
  119. kASDefaultPreferredHeapSize        EQU        16 * 1024
  120. kASDefaultMaxHeapSize            EQU        32 * 1024 * 1024
  121.  
  122. ;*************************************************************************
  123. ;    Source Styles
  124. ;*************************************************************************
  125. ;
  126. ; pascal OSAError ASSetSourceStyles(ComponentInstance scriptingComponent, STHandle sourceStyles)
  127. ;
  128.     IF ¬ GENERATINGCFM THEN
  129.         Macro
  130.         _ASSetSourceStyles
  131.             dc.w     $2F3C
  132.             dc.w     $0004
  133.             dc.w     $1002
  134.             moveq    #0,d0
  135.             dc.w     $A82A
  136.         EndM
  137.     ELSE
  138.         IMPORT_CFM_FUNCTION    ASSetSourceStyles
  139.     ENDIF
  140.  
  141. ;
  142. ;        ComponentCallNow(kASSelectSetSourceStyles, 4);
  143. ;        Errors:
  144. ;        errOSASystemError        operation failed
  145. ;    
  146. ;
  147. ; pascal OSAError ASGetSourceStyles(ComponentInstance scriptingComponent, STHandle *resultingSourceStyles)
  148. ;
  149.     IF ¬ GENERATINGCFM THEN
  150.         Macro
  151.         _ASGetSourceStyles
  152.             dc.w     $2F3C
  153.             dc.w     $0004
  154.             dc.w     $1003
  155.             moveq    #0,d0
  156.             dc.w     $A82A
  157.         EndM
  158.     ELSE
  159.         IMPORT_CFM_FUNCTION    ASGetSourceStyles
  160.     ENDIF
  161.  
  162. ;
  163. ;        ComponentCallNow(kASSelectGetSourceStyles, 4);
  164. ;        Errors:
  165. ;        errOSASystemError        operation failed
  166. ;    
  167. ;
  168. ; pascal OSAError ASGetSourceStyleNames(ComponentInstance scriptingComponent, long modeFlags, AEDescList *resultingSourceStyleNamesList)
  169. ;
  170.     IF ¬ GENERATINGCFM THEN
  171.         Macro
  172.         _ASGetSourceStyleNames
  173.             dc.w     $2F3C
  174.             dc.w     $0008
  175.             dc.w     $1004
  176.             moveq    #0,d0
  177.             dc.w     $A82A
  178.         EndM
  179.     ELSE
  180.         IMPORT_CFM_FUNCTION    ASGetSourceStyleNames
  181.     ENDIF
  182.  
  183. ;
  184. ;        ComponentCallNow(kASSelectGetSourceStyleNames, 8);
  185. ;        This call returns an AEList of styled text descriptors the names of the
  186. ;        source styles in the current dialect.  The order of the names corresponds
  187. ;        to the order of the source style constants, below.  The style of each
  188. ;        name is the same as the styles returned by ASGetSourceStyles.
  189. ;        
  190. ;        Errors:
  191. ;        errOSASystemError        operation failed
  192. ;    
  193. ;
  194. ;    Elements of STHandle correspond to following categories of tokens, and
  195. ;    accessed through following index constants:
  196. ;
  197. kASSourceStyleUncompiledText    EQU        0
  198. kASSourceStyleNormalText        EQU        1
  199. kASSourceStyleLanguageKeyword    EQU        2
  200. kASSourceStyleApplicationKeyword EQU        3
  201. kASSourceStyleComment            EQU        4
  202. kASSourceStyleLiteral            EQU        5
  203. kASSourceStyleUserSymbol        EQU        6
  204. kASSourceStyleObjectSpecifier    EQU        7
  205. kASNumberOfSourceStyles            EQU        8
  206.  
  207. ; Gestalt selectors for AppleScript 
  208. gestaltAppleScriptAttr            EQU        'ascr'
  209. gestaltAppleScriptVersion        EQU        'ascv'
  210.  
  211. gestaltAppleScriptPresent        EQU        0
  212. gestaltAppleScriptPowerPCSupport EQU        1
  213.  
  214.     ENDIF ; __APPLESCRIPT__
  215.